package utils

import (
	"github.com/kataras/iris/v12"
)

// UserCacheModel 用户缓存实体
type UserCacheModel struct {
	IsLogin  bool
	UserID   int64
	UserCode string
	NickName string
}

// UserCache 偿试获得用户缓存
func UserCache(ctx iris.Context) (bool, UserCacheModel) {
	usercache := GetSession(ctx, SessionKeyLoginUser)
	user, ok := usercache.(UserCacheModel)
	return ok, user
}
